//1、创建路由
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/pages/home.vue'
import IndexView from '@/pages/index.vue'

const routes = [
  {
    path: '/',
    name: 'index',
    component: IndexView,
    children:[
      {
        path: '/register',
        name: 'register',
        component: () => import('@/pages/register.vue'),
        meta: {
          title: '注册页'
        }
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/pages/login.vue'),
    meta: {
      title: '登录页'
    }
  }
  ,
  // {
  //   path: '/register',
  //   name: 'register',
  //   component: () => import('@/pages/register.vue'),
  //   meta: {
  //     title: '注册页'
  //   }
  // }
]

const router = createRouter({
  history: createWebHistory(),
  routes
});

export default router;
